package com.dailyblue.java.project.smbms.role.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dailyblue.java.project.smbms.role.bean.Role;
import com.dailyblue.java.project.smbms.role.mapper.RoleMapper;
import com.dailyblue.java.project.smbms.role.service.RoleService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Cacheable(cacheNames = "getById", key = "#id")
    public Role getById(Serializable id) {
        return super.getById(id);
    }

    @Cacheable(cacheNames = "list", key = "0")
    public List<Role> list() {
        return super.list();
    }
}
